package com.hnkywl.sts.entity;

import com.hnkywl.sts.entity.organ.Gsjg;
import com.hnkywl.sts.entity.sys.Yg;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 说明：
 * 包:        com.hnkywl.sts.entity
 * 类描述:    实体基类
 * 创建人:    zcg
 * 创建时间: 13-2-18 上午10:24
 * 修改人:    zcg
 * 修改时间: 13-2-18 上午10:24
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@MappedSuperclass
public class BaseEntity implements Serializable {

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="CREATEORGAN_ID")
    @NotFound(action= NotFoundAction.IGNORE)
    private Gsjg createOrgan;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="CREATEDEPARTMENT_ID")
    @NotFound(action= NotFoundAction.IGNORE)
    private Gsjg createDepartment;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name="CREATEUSER_ID")
    @NotFound(action= NotFoundAction.IGNORE)
    private Yg createUser;

    /**
     * 删除标示  0：未删除 1：删除
     */
    @Column(name = "deleted")
    private int deleted = 0;
    /**
     * 新增时间
     */
    @Column(name = "date_created")
    private Date dateCreated = new Date();
    /**
     * 最后更新时间
     */
    @Column(name = "last_updated")
    private Date lastUpdated;

    public Gsjg getCreateOrgan() {
        return createOrgan;
    }

    public void setCreateOrgan(Gsjg createOrgan) {
        this.createOrgan = createOrgan;
    }

    public Gsjg getCreateDepartment() {
        return createDepartment;
    }

    public void setCreateDepartment(Gsjg createDepartment) {
        this.createDepartment = createDepartment;
    }

    public Yg getCreateUser() {
        return createUser;
    }

    public void setCreateUser(Yg createUser) {
        this.createUser = createUser;
    }

    public int getDeleted() {
        return deleted;
    }

    public void setDeleted(int deleted) {
        this.deleted = deleted;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public Date getLastUpdated() {
        return lastUpdated;
    }

    public void setLastUpdated(Date lastUpdated) {
        this.lastUpdated = lastUpdated;
    }
}
